package com.initialize.auth;

import cn.hutool.core.util.NetUtil;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.openfeign.EnableFeignClients;

import javax.swing.*;

/**
 * Created with IntelliJ IDEA.
 * User: jane
 * Date: 2019/12/24¡
 * Time: 5:09 下午
 * Description: 统一认证
 */
@Slf4j
@EnableFeignClients("com.initialize")
@MapperScan("com.initialize.common.mybatis.plus")
@SpringBootApplication(scanBasePackages = "com.initialize")
public class AuthApplication {

    public static void main(String[] args) {

        JEditorPane jEditorPane = new JEditorPane();
        jEditorPane.setContentType("application/json;charset=utf-8");

        int port = 9010;
        int maxPort = port + 10;
        while (!NetUtil.isUsableLocalPort(port)) {
            if (port > maxPort) {
                log.error("端口超出范围");
            }
            port++;
            log.error("端口占用->>{}", port);
        }
        new SpringApplicationBuilder(AuthApplication.class).
                properties("server.port=" + port).run(args);
    }


}